<html>
<head><meta charset="utf-8"><title>str / String impling Error · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/str.20.2F.20String.20impling.20Error.html">str / String impling Error</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="195843879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/str%20/%20String%20impling%20Error/near/195843879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/str.20.2F.20String.20impling.20Error.html#195843879">(Apr 30 2020 at 14:09)</a>:</h4>
<p><strong>disclaimer</strong>: not advocating for this</p>



<a name="195843925"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/str%20/%20String%20impling%20Error/near/195843925" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/str.20.2F.20String.20impling.20Error.html#195843925">(Apr 30 2020 at 14:09)</a>:</h4>
<p>but is there any technical reason why &amp;str and/or String don't impl std::error::Error?</p>



<a name="195843968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/str%20/%20String%20impling%20Error/near/195843968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/str.20.2F.20String.20impling.20Error.html#195843968">(Apr 30 2020 at 14:09)</a>:</h4>
<p>I know that they can be converted to <code>Box&lt;dyn Error&gt;</code> but that's really not the same thing</p>



<a name="195844076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/str%20/%20String%20impling%20Error/near/195844076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/str.20.2F.20String.20impling.20Error.html#195844076">(Apr 30 2020 at 14:10)</a>:</h4>
<p>you cant use them as a source or coerce them to &amp;dyn Errors</p>



<a name="195844196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/str%20/%20String%20impling%20Error/near/195844196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/str.20.2F.20String.20impling.20Error.html#195844196">(Apr 30 2020 at 14:11)</a>:</h4>
<p>Someone asked me recently and the only things I could think of were "Maybe lifetimes maybe coherence maybe it's just too spooky"</p>



<a name="195845507"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/str%20/%20String%20impling%20Error/near/195845507" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> kennytm <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/str.20.2F.20String.20impling.20Error.html#195845507">(Apr 30 2020 at 14:20)</a>:</h4>
<p>the reason for <code>String: !Error</code> is purely philosophical, not technical. <a href="https://github.com/rust-lang/rust/pull/23979#issuecomment-89079584" title="https://github.com/rust-lang/rust/pull/23979#issuecomment-89079584">https://github.com/rust-lang/rust/pull/23979#issuecomment-89079584</a></p>



<a name="195848980"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/str%20/%20String%20impling%20Error/near/195848980" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/str.20.2F.20String.20impling.20Error.html#195848980">(Apr 30 2020 at 14:43)</a>:</h4>
<p>Makes sense, I imagine using Result&lt;String, String&gt; would be rather error prone</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>